def get_the_num(index):
    j = 2
    index -= 9
    while index - 9 * (10 ** (j - 1)) * j > 0:
        index -= 9 * (10 ** (j - 1)) * j
        j += 1
    # 此时得到的j应该就是代表到了几位数
    if index % j == 0:
        return str(index // j - 1 + 10 ** (j - 1))[-1]
    else:
        return str((index // j) + 10 ** (j - 1))[(index % j) - 1]


indexs = [10, 100, 1000, 10000, 100000, 1000000]
res = 1
for i in indexs:
    res *= int(get_the_num(i))
print(res)
